home *** CD-ROM | disk | FTP | other *** search
- /* FreshBar-Demoscript */
-
- say "FreshBar - Demoskript - ©1998 by Strange Intelligence"
- say "written by Christian <City> Taulien."
- say "$VER: FreshBar-Demoscript 1.1 (29.05.98)"
-
- OPTIONS RESULTS
-
- address "FRESHBAR_REXX.1"
-
- /**********************/
- /* first window */
- /**********************/
-
- /* first we create the window */
- CREATEBARWINDOW "Demo-Skript"
- WinHandle1 = RESULT
-
- /* set the width of the window */
- SETBARWINDOWWIDTH WinHandle1 200
-
- /* then we add a bar to it */
- ADDBAR WinHandle1 100
- BarHandle1 = RESULT
-
- /* set the numeric progressdisplaymode to nothing*/
- SETPROGRESSMODE WinHandle1 BarHandle1 0
-
- say "A simple bar..."
- /* Now open the window */
- OPENBARWINDOW WinHandle1
-
- /* do something with the bar */
- do i=0 to 100
- SETCURRENT WinHandle1 BarHandle1 i
- /* Note, that DELAY is a internal/secret command
- ** of FreshBar and may not be supported in future
- ** its just to get the bars slowlier */
- DELAY 1
- end
-
- /* Remove the bar and add a new one*/
- REMOVEBAR WinHandle1 BarHandle1
- say "A simple bar with title ..."
- ADDBAR WinHandle1 100 Name "Amiga Marktanteil: "
- BarHandle1 = RESULT
-
- /* We don't want to see any number display */
- SETPROGRESSMODE WinHandle1 BarHandle1 0
-
- /* do something with the bar */
- do i=10 to 100 by 10
- SETCURRENT WinHandle1 BarHandle1 i
- DELAY 20
- end
-
- /* We want to see percentage display */
- SETPROGRESSMODE WinHandle1 BarHandle1 1
-
- say "now with percentage display..."
- /* do something with the bar */
- do i=10 to 100 by 5
- SETCURRENT WinHandle1 BarHandle1 i
- DELAY 5
- end
-
- /* We want to see absolute-numbers */
- SETPROGRESSMODE WinHandle1 BarHandle1 2
-
- say "absolute numbers are also possible..."
- /* do something with the bar */
- do i=10 to 100 by 5
- SETCURRENT WinHandle1 BarHandle1 i
- DELAY 5
- end
-
- /* delete the window */
- DELETEBARWINDOW WinHandle1
-
-
- /**********************/
- /* second window */
- /**********************/
-
- /* first we create the window */
- CREATEBARWINDOW "<--CloseGadget_optional" CLOSEGADGET
- WinHandle1 = RESULT
-
- /* set the width of the window */
- SETBARWINDOWWIDTH WinHandle1 200
-
- /* Add a new bar */
- ADDBAR WinHandle1 100 NAME "PC Marktanteil: "
- BarHandle1 = RESULT
-
- /* We want to see percentage display */
- SETPROGRESSMODE WinHandle1 BarHandle1 1
-
- say "Optional CloseGadget..."
-
- /* Now open the window */
- OPENBARWINDOW WinHandle1
-
- /* do something with the bar */
- do i=100 to 0 by -1
- SETCURRENT WinHandle1 BarHandle1 i
- DELAY 1
- end
-
- /* delete the window */
- DELETEBARWINDOW WinHandle1
-
-
- /**********************/
- /* third window */
- /**********************/
-
- /* first we create the window */
- CREATEBARWINDOW "Optional_OK-Button" "_Fritz!" CLOSEGADGET
- WinHandle1 = RESULT
-
- /* set the width of the window */
- SETBARWINDOWWIDTH WinHandle1 200
-
- /* add a new bar */
- ADDBAR WinHandle1 100 Name "PC Marktanteil: "
- BarHandle1 = RESULT
-
- /* We want to see percentage display */
- SETPROGRESSMODE WinHandle1 BarHandle1 1
-
- say "Optional button..."
- /* Now open the window */
- OPENBARWINDOW WinHandle1
-
- /* do something with the bar */
- do i=100 to 0 by -1
- SETCURRENT WinHandle1 BarHandle1 i
- DELAY 1
- end
-
- /* delete the window */
- DELETEBARWINDOW WinHandle1
-
-
- /**********************/
- /* fourth window */
- /**********************/
-
- /* first we create the window */
- CREATEBARWINDOW "Colors_are_possible" "_Cool!" CLOSEGADGET
- WinHandle1 = RESULT
-
- /* set the width of the window */
- SETBARWINDOWWIDTH WinHandle1 200
-
- /* adding a bar */
- ADDBAR WinHandle1 100 Name "PC Marktanteil: "
- BarHandle1 = RESULT
-
- /* We want to see percentage display */
- SETPROGRESSMODE WinHandle1 BarHandle1 1
-
- /* Play with colors */
- SETFILLPEN WinHandle1 BarHandle1 12
- SETBACKPEN WinHandle1 BarHandle1 11
-
- say "Colours make the world more beautiful..."
- /* Now open the window */
- OPENBARWINDOW WinHandle1
-
- /* do something with the bar */
- do i=100 to 0 by -1
- SETCURRENT WinHandle1 BarHandle1 i
- DELAY 1
- if i<50 then
- do
- SETFILLPEN WinHandle1 BarHandle1 i
- SETBACKPEN WinHandle1 BarHandle1 50-i
- end
- end
-
- /* Play with colors */
- SETFILLPEN WinHandle1 BarHandle1 8
- SETBACKPEN WinHandle1 BarHandle1 11
-
- say "Resizing ist possible..."
- /* do something with the bar */
- do i=100 to 0 by -10
- SETCURRENT WinHandle1 BarHandle1 i
- SETBARWINDOWWIDTH WinHandle1 200+i
- DELAY 20
- end
-
- /* show the feature of resizing the window */
- SETBARWINDOWWIDTH WinHandle1 400
- DELAY 30
- SETBARWINDOWWIDTH WinHandle1 180
- DELAY 30
- SETBARWINDOWWIDTH WinHandle1 300
- DELAY 30
- SETBARWINDOWWIDTH WinHandle1 200
- DELAY 30
-
- say "But size isn't everything..."
- /* do something with the bar */
- do i=100 to 0 by -10
- SETCURRENT WinHandle1 BarHandle1 i
- SETBARWINDOWPOS WinHandle1 10+i*3 10+i*2
- DELAY 10
- end
-
- say "Center position..."
- /* reset the window's position */
- SETBARWINDOWPOS WinHandle1 X "-1" Y "-1"
-
- DELAY 30
-
- say "Multiple bars are no problem..."
- /* add a bar and configure it */
- ADDBAR WinHandle1 1500 Name "Amiga Marktanteil: "
- BarHandle2 = RESULT
- SETFILLPEN WinHandle1 BarHandle2 9
- SETBACKPEN WinHandle1 BarHandle2 6
- SETPROGRESSMODE WinHandle1 BarHandle2 0
-
- /* add a bar and configure it */
- ADDBAR WinHandle1 2100 Name "Apple Marktanteil: "
- BarHandle3 = RESULT
- SETFILLPEN WinHandle1 BarHandle3 13
- SETBACKPEN WinHandle1 BarHandle3 4
- SETPROGRESSMODE WinHandle1 BarHandle3 2
-
- /* slide the bars */
- do i=100 to 0 by -1
- SETCURRENT WinHandle1 BarHandle1 i
- SETCURRENT WinHandle1 BarHandle2 VALUE 1500-i*10
- SETCURRENT WinHandle1 BarHandle3 VALUE i*21
- end
-
- /* add a bar and configure it */
- ADDBAR WinHandle1 500 Name "Archimedes Marktanteil: "
- BarHandle3 = RESULT
- SETFILLPEN WinHandle1 BarHandle3 0
- SETBACKPEN WinHandle1 BarHandle3 3
- SETPROGRESSMODE WinHandle1 BarHandle3 1
-
- say "You can test the buttonstate for canceling actions..."
- say "Press the Button!"
-
- /* do something with the bars */
- do i=0 to 100 by 1
- SETCURRENT WinHandle1 BarHandle1 100-i
- SETCURRENT WinHandle1 BarHandle2 i*10
- SETCURRENT WinHandle1 BarHandle3 100-i
- DELAY 1
-
- /* test the button state */
- TESTOKBUTTON WinHandle1
- if RESULT == 1 then leave
- end
-
- /* evaluate the users behavior */
- if (i<100) then
- say "Stopped at " i
- else
- say "You didn't press the button!"
-
-
-
- /*****************************************************/
- /* Now we create a second window at the same time */
- /* to show the feature of creating unlimited numbers */
- /* of windows containing an unlimited number of bars */
- /* in turn. */
- /*****************************************************/
-
- /* Create the window */
- CREATEBARWINDOW "Multiple_Windows" "_CITY!" CLOSEGADGET
- WinHandle2 = RESULT
-
- /* adding several bars */
- ADDBAR WinHandle2 1500 Name "Desitination: "
- BarHandle1 = RESULT
- ADDBAR WinHandle2 2100 Name "Source: "
- BarHandle2 = RESULT
-
- /* configure bar #1 */
- SETFILLPEN WinHandle2 BarHandle1 9
- SETBACKPEN WinHandle2 BarHandle1 6
- SETPROGRESSMODE WinHandle2 BarHandle1 0
-
- /* configure bar #2 */
- SETFILLPEN WinHandle2 BarHandle1 13
- SETBACKPEN WinHandle2 BarHandle1 4
- SETPROGRESSMODE WinHandle2 BarHandle2 2
-
- /* make sure not to cover the other window */
- SETBARWINDOWPOS WinHandle1 X 20 Y 20
-
- say "And finally multiple windows are no problem too..."
- /* present our work on screen */
- OPENBARWINDOW WinHandle2
-
- /* now lets dance */
- do i=0 to 100 by 1
- /* update the values from the 1st window */
- SETCURRENT WinHandle1 BarHandle1 100-i
- SETCURRENT WinHandle1 BarHandle2 i*10
- SETCURRENT WinHandle1 BarHandle3 100-i
-
- /* update the 2nd window's bars */
- SETCURRENT WinHandle2 BarHandle1 i*5
- SETCURRENT WinHandle2 BarHandle2 i*10
- DELAY 1
- end
-
- About
-
- /* delete the windows */
- DELETEBARWINDOW WinHandle2
- DELETEBARWINDOW WinHandle1
-
- say "FreshBar is great, isn't it?!"
-
- Quit
-
-